package com.example.c94s3plyhyfc.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.sql.Timestamp;

@Data
public class Bbs {
    private Integer id;
    @NotEmpty(message = "标题不能为空!")
    @Length(min = 4, max = 50, message = "标题长度必须是4~50个字!")
    private String title;
    @JsonFormat(pattern = "yyyy年MM月dd日 HH时mm分ss秒")
    private Timestamp intime;
    @NotEmpty(message = "内容不能为空!")
    @Length(min = 4, max = 500, message = "内容长度必须是4~500个字!")
    private String content;
    // 外键
    private Integer typeId;
    // 分类 ==> MyBatis 一对一 关联查询
    private Type type;
}
